package lanou3g.myfirstapp36kr.activity;

import android.content.Intent;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import lanou3g.myfirstapp36kr.R;
import lanou3g.myfirstapp36kr.base.BaseActivity;
import lanou3g.myfirstapp36kr.fragment.MyOrderViewPagerFragment;

/**
 * Created by dllo on 16/8/20.
 */
public class MessageActivity extends BaseActivity {
    private TextView textView;
    private FragmentManager manager;
    private FragmentTransaction fragmentTransaction;
    @Override
    protected int getLayout() {
        return R.layout.activity_message;
    }

    @Override
    protected void initView() {
        findViewById(R.id.iv_back_message).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        textView = (TextView) findViewById(R.id.tv_person_message);
        manager = getSupportFragmentManager();
        fragmentTransaction = manager.beginTransaction();

    }

    @Override
    protected void initData() {
        fragmentTransaction.replace(R.id.frame_layout_message,new MyOrderViewPagerFragment());
        fragmentTransaction.commit();
        Intent intent = getIntent();
        String tv = intent.getStringExtra("tv");
        textView.setText(tv);

    }
}
